import request from "@/utils/request";

// 文章分类  列表查询所有数据
export const articleCategoryListService = () => {
    return request.get('/category');
    // return request.get('/category/page',params);
}
// 文章分类  查询所有人的数据  列表查询分页数据以及条件数据
export const articleCategoryPageService = (params) => {
    return request.get('/category/page', { params: params });
}
// 文章分类  查询当前用户的数据  列表查询分页数据以及条件数据
export const articleCategoryPageSelfService = (params) => {
    return request.get('/category/page', { params: params });
}

// 文章分类添加查询
export const articleCategoryAddService = (category) => {
    return request.post('/category', category)
}

// 文章分类修改
export const articleCategoryUpdateService = (category) => {
    return request.put('/category', category)
}

// 文章分类删除
export const articleCategoryDeleteService = (category) => {
    return request.delete('/category', category)
}
// 文章分类删除
export const articleCategoryDeleteByIdService = (id) => {
    return request.delete('/category/' + id)
}




// 文章查询， 分页查询含有条件的文章
export const articlePageService = (params) => {
    return request.get('/article/page', { params: params });
}

// 文章添加 
export const articleAddService = (articleData) => {
    return request.post('/article',articleData)
}

//  文章删除
export const articleDeleteService = (id) => {
    return request.delete('/article/' + id)
}

// 文章更新
export const articleUpdateService = (articleData) => {
    return request.put('/article',articleData)
}